<?php
	include "login.php";
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Alterar Senha</title>
<script src="jquery-1.5.1.min.js" type="text/javascript"></script>
<script src="jquery.validate.min.js" type="text/javascript"></script>

<link rel="stylesheet" href="jquery.validate.password.css" type="text/css" media="screen"/>
<script src="jquery.validate.password.js" type="text/javascript"></script>

<script type="text/javascript">
	$(document).ready(function() {
		$("#senha").valid();	
	});
	$().ready(function() {
		$("#formSenha").validate({
			rules: {
				atual: {
					required: true,
					minlength: 4
				},
				senha: {
					required: true,
					minlength: 4
				},
				senha2: {
					required: true,
					equalTo: "#senha"
				}
			},
			messages: {
				atual: {
					required: "Preencha a senha atual",
					minlength: "A senha deve ter no mínimo 4 caracteres"
				},
				senha: {
					required: "Preencha uma senha",
					minlength: "A senha deve ter no mínimo 4 caracteres"
				},
				senha2: {
					required: "Preencha uma senha",
					equalTo: "A senha deve ser igual a senha digitada"
				}
			}
		})
	});
</script>
</head>

<body>
	<h1>Alterar Senha</h1>

	<form name="formSenha" id="formSenha" method="post" action="senhaSalvar.php">
		<label for="atual">Digite a senha atual: </label>
		<input type="password" name="atual" id="atual" size="20" />
		<br />
		<label for="senha">Digite a nova senha: </label>
		<input type="password" name="senha" id="senha" size="20" />

		<div class="password-meter">
			<div class="password-meter-message"></div>
			<div class="password-meter-bg">
				<div class="password-meter-bar"></div>
			</div>
		</div>

		<br />
		<label for="senha2">Redigite a nova senha: </label>
		<input type="password" name="senha2" id="senha2" size="20" />
		<br />
        <br />
		<input type="submit" value="Alterar Senha" />
	</form>
</body>
</html>
